package payroll.trans;

import payroll.Employee;
import payroll.PaymentClassification;
import payroll.PayrollDatabase;
import payroll.Transaction;
import payroll.method.HoldMethod;

public abstract class AddEmployeeTransaction implements Transaction{

	protected int empId;
	protected String name;
	protected String address;

	public AddEmployeeTransaction() {
		super();
	}
	
	public AddEmployeeTransaction(int empId, String name, String address) {
		super();
		this.empId = empId;
		this.name = name;
		this.address = address;
	}
	
	

	@Override
	public void execute() {
		Employee e = new Employee(empId, name ,address);
	    e.setPaymentClassification(getPaymentClasification());
	    e.setPaymentMethod(new HoldMethod());
	    PayrollDatabase.saveEmployee(e);
	}
	
	protected abstract PaymentClassification getPaymentClasification();

}